#include <math.h>
#include <stdio.h>

double calculate(double kn, double kg, double t)
{
    //计算指数
    double  answer = exp ((kn+kg)*t);
    //计算分子、分母
    double  numerator = kn*(answer - 1);
    double denominator = kg + kn*answer;
    double  alpha = numerator / denominator;

    return alpha;
}

//测试代码
int main (int argc, char **argv)
{
    double kn = 1, kg=2, t = 4;

    printf("答案为 = %lf\n", calculate(kn, kg, t));
}
